<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //RefImpl  其实两个单词的缩写 reference 引用  ,implement 实现
        let number = 18;
        let person ={
            name:'张三',
            sex:'男',
            // age:number
        }
        Object.defineProperty(person,'age',{
            // value:20,
            // writable:true,//配置是否可以更改
            // enumerable:true,  //配置是否可以被枚举
            // configurable:true, //配置是否可以删除
            get(){
                console.log('有人来读取age属性了');
                return number
            },
            set(value){
                console.log('有人来修改age属性了');
                number=value
            }
        })
    </script>
</body>
</html>